//
//  LayoutViewControllerViewController.m
//  LayoutViewController
//
//  Created by Paolo Marcolli on 04/01/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "LayoutViewControllerViewController.h"

@implementation LayoutViewControllerViewController
@synthesize btn_Test01,btn_Test02;

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Release any cached data, images, etc that aren't in use.
}

-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
    if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
        toInterfaceOrientation == UIInterfaceOrientationLandscapeRight)
    {
        btn_Test01.frame = CGRectMake(20, 20, 210, 260);
        btn_Test02.frame = CGRectMake(250, 20, 210, 260);
    }
    else
    {
        btn_Test01.frame = CGRectMake(20, 20, 280, 205);
        btn_Test02.frame = CGRectMake(20, 233, 280, 207);
    }
}


#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
    self.btn_Test01=nil;
    self.btn_Test02=nil;
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
}

- (void)viewWillDisappear:(BOOL)animated
{
	[super viewWillDisappear:animated];
}

- (void)viewDidDisappear:(BOOL)animated
{
	[super viewDidDisappear:animated];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    //return YES
    return (interfaceOrientation!=UIInterfaceOrientationPortraitUpsideDown);
}

@end
